// 对 HTML5 localStorage 和sessionStorage 进行了扩展
import WebStorageCache from "web-storage-cache";

type CacheType = "sessionStorage" | "localStorage";

export const useCache = (type: CacheType = "localStorage") => {
  const wsCache: WebStorageCache = new WebStorageCache({
    storage: type,
  });

  return {
    wsCache,
  };
};
